﻿<Button Color="Color.Primary" OnClick="OnTransitionShow" Text="FadeOut"></Button>
<Transition TransitionType="TransitionType.FadeOut" Show="TransitionEndShow" OnTransitionEnd="OnTransitionEndShow">
    <div class="my-3">FadeOut</div>
</Transition>
<ConsoleLogger @ref="Logger" />

@code {
    [NotNull]
    private ConsoleLogger? Logger { get; set; }

    private bool TransitionEndShow { get; set; }

    private void OnTransitionShow()
    {
        TransitionEndShow = true;
    }

    private Task OnTransitionEndShow()
    {
        TransitionEndShow = false;
        Logger.Log("animation ends");
        StateHasChanged();
        return Task.CompletedTask;
    }
}
